package com.kfm.dao.impl;

import com.kfm.dao.LogDao;
import lombok.extern.java.Log;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class LogDaoImpl implements LogDao {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Override
    public int save(com.kfm.entity.Log log) {
        String sql = "insert into log (content, method, args, start_time, time, result)" +
                " values(?, ?, ?, ?, ?, ?)";
        return jdbcTemplate.update(sql, log.getContent(), log.getMethod(), log.getArgs(), log.getStartTime(), log.getTime(), log.getResult());
    }
}
